package com.shanzmoo.db.module.psys.domain.vo;

import com.shanzmoo.db.module.psys.entity.PSysRoleEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

/**
 * 角色选则信息
 * @author Gzhao 2020/12/30
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor(access = AccessLevel.PRIVATE)
@ApiModel("角色选则信息")
public class RoleSelectVO {

    @ApiModelProperty("角色ID")
    private Integer roleId;

    @ApiModelProperty("角色名")
    private String roleName;

    @ApiModelProperty("是否被选中")
    private Boolean selected = false;

    public static RoleSelectVO create(PSysRoleEntity role) {
        return RoleSelectVO.builder()
                .roleId(role.getId())
                .roleName(role.getRoleName())
                .build();
    }
}
